define([],function (){
    const MuFileUpload = {
        template: `<el-upload
                v-model:file-list="fileList"
                class="upload-demo"
                :action="uploadurl"
                :on-success="success"
        >
            <el-button type="primary">上传文件</el-button>
        </el-upload>`,
        data(){
            return {
                fileList: [],
                uploadurl:Config.upload.uploadurl
            }
        },
        emits:['update:modelValue'],
        methods: {
            success(response, uploadFile, uploadFiles){
                // console.log(response)
                if(response.code == 1){
                    this.$emit('update:modelValue',response.data.url)
                }
            }
        }
    }
    return MuFileUpload
})